//
//  Created by cktim852 on 04/04/2010.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "HTTPUtil.h"

#ifdef ALLOW_SSL

@interface NSURLRequest (Certificates)
+ (void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString*)host;
@end

#endif

@implementation HTTPUtil

// set allows SSL certificate
+(void) setAllowsSSLCertificate:(NSURLRequest *)request url:(NSURL *)url
{
    
#ifdef ALLOW_SSL
    // certificate checking
    //only used for testing against secured servers - needs to be removed for live
    //need to add user:password@url into the config for the specified server to use
    [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[url host]];
    DebugRDSLog(@"Allowing SSL for: %@",[[request URL] host]);
#endif
    
}

@end
